/**
 * The MIT License
 * <p>
 * Copyright (c) 2017
 */
package com.seelyn.flow.work;

import com.seelyn.flow.engine.WorkFlowParams;

import java.util.concurrent.Callable;

/**
 * Implementations of this interface must:
 * <ul>
 * <li>catch exceptions and return {@link WorkStatus#FAILED}</li>
 * <li>make sure the work in finished in a finite amount of time</li>
 * </ul>
 * <p>
 * Work name must be unique within a workflow.
 */
public interface Work extends Callable<WorkReport> {

    /**
     * Get work name
     *
     * @return work name
     */
    String getName();

    /**
     * set params
     *
     * @param params params
     */
    void setParams(WorkFlowParams params);

    @Override
    WorkReport call();
}
